#include "teststdafx.h"
#include "stdafx.h"
#include <gtest/gtest.h>

#include "Business/LimitCalculator.h"

class LimitCalculatorTest : public testing::Test
{
protected:

	virtual void SetUp()
	{
	}

	virtual void TearDown()
	{

	}
};

TEST_F(LimitCalculatorTest, test1)
{
	{
		LimitCalculator calculator(100,5,0.05);
		EXPECT_EQ(105,calculator.GetUpperLimit());
		EXPECT_EQ(95,calculator.GetLowerLimit());
	}

	{
		LimitCalculator calculator(110,5,0.05);
		EXPECT_EQ(115,calculator.GetUpperLimit());
		EXPECT_EQ(100,calculator.GetLowerLimit());
	}

	{
		LimitCalculator calculator(17535,5,0.05);
		EXPECT_EQ(18410,calculator.GetUpperLimit());
		EXPECT_EQ(16655,calculator.GetLowerLimit());
	}
	
	{
		LimitCalculator calculator(17415,5,0.05);
		EXPECT_EQ(18285,calculator.GetUpperLimit());
		EXPECT_EQ(16540,calculator.GetLowerLimit());
	}
	
	{
		LimitCalculator calculator(57550,10,0.05);
		EXPECT_EQ(60420,calculator.GetUpperLimit());
		EXPECT_EQ(54670,calculator.GetLowerLimit());
	}

	{
		LimitCalculator calculator(52120,10,0.08);
		EXPECT_EQ(56280,calculator.GetUpperLimit());
		EXPECT_EQ(47950,calculator.GetLowerLimit());
	}

	{
		LimitCalculator calculator(14570,5,0.08);
		EXPECT_EQ(15735,calculator.GetUpperLimit());
		EXPECT_EQ(13400,calculator.GetLowerLimit());
	}


	{
		LimitCalculator calculator(16310,5,0.07);
		EXPECT_EQ(17450,calculator.GetUpperLimit());
		EXPECT_EQ(15165,calculator.GetLowerLimit());
	}
}